package com.neusoft.hifly.push.email.pojo;

import java.io.InputStream;
import java.io.Serializable;

import com.neusoft.hifly.commons.lang.format.ByteFormat;

/**
 * Title: 核心类库
 * <p>
 * Description: 邮件附件实体
 * <p>
 * Copyright: 2019
 * <p>
 * Company: 东软汉枫
 *
 * @author lh_neu
 * @version 1.0.0
 */
public class MailFileObj implements Serializable {

	private static final long serialVersionUID = -895195952567356206L;
	// 附件的Id
	private long id;
	// 附件的名称
	private String name;
	// 附件的路径
	private String path;
	// 附件的大小
	private long size;
	// 附件流
	private InputStream is;

	// ############################## 页面元素
	// 经过转换的附件大小
	private String sizeStr;

	public String getSizeStr() {
		if (size >= 0) {
			sizeStr = new ByteFormat().format(size);
		}
		return sizeStr;
	}

	public long getId() {
		return id;
	}

	public void setId(final long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(final String name) {
		this.name = name;
	}

	public String getPath() {
		return path;
	}

	public void setPath(final String path) {
		this.path = path;
	}

	public long getSize() {
		return size;
	}

	public void setSize(final long size) {
		this.size = size;
	}

	public InputStream getIs() {
		return is;
	}

	public void setIs(final InputStream is) {
		this.is = is;
	}

	public void setSizeStr(final String sizeStr) {
		this.sizeStr = sizeStr;
	}

}
